home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
gnu
/
dejagnu.lha
/
dejagnu-1.0.1
/
expect
/
CHANGES.3to4
< prev
next >
Wrap
Text File
|
1993-03-09
|
3KB
|
80 lines
This is an alpha version of Expect (version 4) for Tcl 6.7. The most
recent version is available on ftp.cme.nist.gov as pub/expect/alpha.tar.Z.
The implementation is not complete and I reserve the right to change
things (hence the designation "alpha"). Hopefully, it will be
completed by the time that Tcl 7.0 is released. What remains
uncomplete (and high on the priority list) will not be a problem for
most people:
1) "interact" doesn't work on systems that do not have select or poll.
The improvements that people will find most interesting are:
1) Expect version 4 is designed to work with Tcl 6.7 and Tk 3.2.
(Earlier versions of Expect will not work with Tcl 6.7)
Expect can now be layered in with any Tcl program.
Note that in Tk, Expect's send command is called "send_spawn".
2) The interact command has been totally rewritten and supports regular
expressions, timeout/eof patterns, and a number of other new things.
3) The default behavior of ^C (SIGINT) is exit whether or not you are in
a read.
4) Expect uses "sane" terminal parameters by default, allowing scripts
to work the same whether inside emacs shell mode or not. (See man
page on "spawn" for more info.)
5) All the hard parts of the installation process are automated. This
was done primarily by Rob Savoye at Cygnus. Thank you, Rob!
6) It is now possible to buy a support contract for Expect from Cygnus.
All differences are described in the man page. Some of the less
significant differences are described in the HISTORY file.
This version also introduces one incompatibility that may require
changes to scripts. While this may initially annoy you, the final
result will simplify the process of writing scripts. Namely:
In version 3, the expect command accepted lists of glob-style patterns
such as:
expect "a\ b c" action
where "a b" or "c" would cause action to be executed. The problem
with this is that the pattern list is hard to write and hard to read.
Patterns with control-characters, backslashes and dollar signs were
very difficult to deal with.
Regular-expression patterns provide a much simpler solution. Via the
alternation feature (using a "|") the above pattern can be written as:
expect -re "a b|c" action
I was concerned about people having a significant investment in code
that depended on the old syntax but responders to a comp.lang.tcl poll
about such a change in pattern handling were 100% in favor of it. (I
even proposed hooks for backward compatibility, but there was no
interest in it.)
Fortunately, most simple things will work as before including:
expect foobar
expect {foobar}
expect "foobar"
expect "foo\ bar"
However, some things won't work as before. For example, the following
will behave differently - now the braces will be considered as part of
the pattern.
expect "{foo bar}"
Here are examples of patterns in my own code that I had to change:
was changed to
Version 3 pattern list Version 4 pattern
{Whois:\ } "Whois: "
{No\ match} "No match"
{250*ftp>* 200*ftp>*} -re "2(5|0)0.*ftp>.*"
{{Press Return to continue*}} "Press Return to continue*"
{*\r\n*\\\\\r\n} "\r\n*\\\r\n"